package com.treasure.domain.iqap;

import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.treasure.common.model.ChatResponse;
import com.treasure.domain.domain.entity.QuestionRequest;

import java.io.IOException;

/**
 * @author sunhongmin
 * @date 2023/8/23 21:08
 * @description
 */
public interface IntelligentAnswerProcessor {
    /**
     * API 测试
     */
    @Deprecated
    String questionAndAnswer(String question, String promptTemplate) throws IOException;

    /**
     * 调用执行链，生成答案
     * @param questionRequest 问题请求
     * @param syncCall 是否同步调用，syncCall=true 将阻塞等待结果返回 syncCall=false 将发送SSE
     * @return 答案
     * @throws IOException IO流异常
     * @throws NoApiKeyException 大预言模型SDK异常
     * @throws InputRequiredException 大预言模型SDK异常
     */
    ChatResponse conversationForChain(QuestionRequest questionRequest, Boolean syncCall) throws IOException, NoApiKeyException, InputRequiredException;
}
